import java.util.Scanner;

/**
 * @author caesar
 * @date 2025/7/1
 * @apiNote
 */
/*
案例需求：
（1）用一个数组，保存12个月的英语单词
{"January","February","March","April","May","June","July","August","September","October","November","December"}
（2）从键盘输入1-12，显示对应的单词。*/
public class homework1_1 {
    public static void main(String[] args) {
        String[] month = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
        Scanner input = new Scanner(System.in);
        //判断输入
        int monthNum = 0;
        while (true) {
            System.out.print("请输入1-12之间的正整数，会输出对应的月份：");
            monthNum = input.nextInt();
            if (monthNum >= 1 && monthNum <= 12) {
                break;
            } else {
                System.out.println("输入有误，请重新输入：");
            }
        }
        System.out.println(month[monthNum - 1]);
        input.close();
    }
}
